package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectDatabase {
	Connection conn;
	DatabaseConfig dataconfig;
	public ConnectDatabase(DatabaseConfig dataconfig) {
		this.dataconfig=dataconfig;
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
	Connection getConnection(){
		
		try {
			conn=DriverManager.getConnection(dataconfig.getUrl(),dataconfig.getUserName(),dataconfig.getPassword());
		} catch (SQLException e) {
			e.printStackTrace();
		}
			return conn;
	}
}
